﻿/*------------------------------------------------
// File Description: UserToken DataBase Entity
// Author:			 汪亮
// Create Time:		 2020-03-14 22:39:43
//------------------------------------------------*/

using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 用户令牌表
    /// </summary>
    [Table(nameof(UserToken))]
    public class UserToken : BaseEntity
    {
        private string _token = string.Empty;

        #region Public Property

        ///<Summary>
        /// 用户ID
        ///</Summary>
        public int UserId { get; set; }

        ///<Summary>
        /// 令牌
        ///</Summary>
        public string Token
        {
            get { return string.IsNullOrWhiteSpace(_token) ? string.Empty : _token; }
            set { _token = value; }
        }

        ///<Summary>
        /// 过期时间
        ///</Summary>
        public DateTime Expires { get; set; }
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 用户令牌表
        /// </summary>
        public virtual DbSet<UserToken> UserTokens { get; set; }
    }
}